CommandTranslate Class Reference

#include <CommandTranslate.h>

Inheritance diagram for CommandTranslate:

Command List of all members.

Public Member Functions

 CommandTranslate (TraffEduObject *obj, osg::Vec3 old_position, osg::Vec3 new_position, OSGWindows *osgwind)
bool execute ()
bool unexecute ()

Private Attributes

OSGWindows * osgwind_
vector< TraffEduObject * > translatedObjs_
osg::Vec3 old_position_
osg::Vec3 new_position_
TraffEduObject * obj_
int first_entrance

Detailed Description

Definition at line 7 of file CommandTranslate.h.


Constructor & Destructor Documentation

CommandTranslate::CommandTranslate (  TraffEduObject *  obj,
osg::Vec3  old_position,
osg::Vec3  new_position,
OSGWindows *  osgwind
) 
 

A constructor. Initializes osgwind_, old_position_, and new_position_ variables.

Parameters:
obj a TraffEduObject pointer.
old_position a osg::Vec3 variable.
new_position a osg::Vec3 variable.
osgwind an OSGWindows pointer.

Definition at line 2 of file CommandTranslate.cpp.

References first_entrance, new_position_, obj_, old_position_, osgwind, osgwind_, and translatedObjs_.


Member Function Documentation

bool CommandTranslate::execute (   )  [virtual]
 

do the translation operation.

Returns:
Operation success

Implements Command.

Definition at line 12 of file CommandTranslate.cpp.

References first_entrance, new_position_, and translatedObjs_.

bool CommandTranslate::unexecute (   )  [virtual]
 

undo the translation operation.

Returns:
Operation success

Implements Command.

Definition at line 24 of file CommandTranslate.cpp.

References old_position_, and translatedObjs_.


Member Data Documentation

int CommandTranslate::first_entrance [private]
 

a private variable. It shows how many times is the execute function is called.

Definition at line 45 of file CommandTranslate.h.

Referenced by CommandTranslate(), and execute().

osg::Vec3 CommandTranslate::new_position_ [private]
 

a private variable. It is initialized with position of the object(s) after the translation operation.

Definition at line 33 of file CommandTranslate.h.

Referenced by CommandTranslate(), and execute().

TraffEduObject* CommandTranslate::obj_ [private]
 

a private variable. It is used to hold the translated object.

Definition at line 39 of file CommandTranslate.h.

Referenced by CommandTranslate().

osg::Vec3 CommandTranslate::old_position_ [private]
 

a private variable. It is initialized with position of the object(s) before the translation operation.

Definition at line 27 of file CommandTranslate.h.

Referenced by CommandTranslate(), and unexecute().

OSGWindows* CommandTranslate::osgwind_ [private]
 

a private variable. It is initialized with the unique OSGWindows instance.

Definition at line 15 of file CommandTranslate.h.

Referenced by CommandTranslate().

vector<TraffEduObject*> CommandTranslate::translatedObjs_ [private]
 

a private vector of TraffEduObjects. It holds the translated objects.

Definition at line 21 of file CommandTranslate.h.

Referenced by CommandTranslate(), execute(), and unexecute().


The documentation for this class was generated from the following files:
Generated on Sun May 28 18:54:12 2006 for TraffEdu by  doxygen 1.4.6-NO